import gevent


def task01(n):
    for i in range(n):
        print("task01", i)
        gevent.sleep(0.1)


def task02(n):
    for i in range(n):
        print("task02", i)
        gevent.sleep(0.1)


def task03(n):
    for i in range(n):
        print("task03", i)
        gevent.sleep(0.1)


print("---1---")
g1 = gevent.spawn(task01, 5)
print("---2---")
g2 = gevent.spawn(task02, 5)
print("---3---")
g3 = gevent.spawn(task03, 5)
print("---4---")
g1.join()
g2.join()
g3.join()
